/**
 * @Description: 指令入口
 * @Author: zhen
 * @Date: 2023-10-19
 */
import { App } from 'vue';
import draggable from './modules/draggable';
import debounce from './modules/debounce';
import throttle from './modules/throttle';

// 自定义指令
const directivesList: any = {
  draggable,
  debounce,
  throttle
};

const directives = {
  install: function (app: App<Element>) {
    Object.keys(directivesList).forEach((key) => {
      // 注册所有自定义指令
      app.directive(key, directivesList[key]);
    });
  }
};

export default directives;
